package com.fanshuai.soring.boot.controller;

import com.fanshuai.soring.boot.contants.CommonConstants;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

import java.net.URI;

@RestController
public class NotFoundController {

    @RequestMapping("/notFound")
    public Mono<String> notFound(ServerWebExchange serverWebExchange) {
        URI uri = serverWebExchange.getAttribute(CommonConstants.ORIGINAL_URI);
        return Mono.just("not found by webflux, uri=" + uri);
    }
}
